import { getHbDetail } from '../../../api/recharge/recharge';

Page({
    data: {
        hbyRemainMoney: 0,
        hbyDetailList: [],
    },
    onLoad: function (options) {
        this.setData({
            hbyRemainMoney: options.hbyRemainMoney,
        });
        getHbDetail().then((res) => {
            console.log(res);
            let tmpHbyDetailList = this.data.hbyDetailList;
            tmpHbyDetailList = res.data.list;
            if (tmpHbyDetailList.length > 0) {
                this.setData({
                    hbyDetailList: tmpHbyDetailList,
                });
            }
        }).catch((err) => {
            console.log(err);
        })
    },
    onShow: function () {
    },
    onUnload: function () {
    },
    toWithdraw: function () {
        wx.navigateTo({
            url: '/pages/userCenter/withdraw/withdraw?hbyRemainMoney=' + this.data.hbyRemainMoney,
        });
    },
});